from flask import Flask
from model.db import db
from controller import userController


def create_app():
    app = Flask(__name__)
    app.config.from_object('config')
    #  蓝图注册
    register_buleprint(app)

    # 数据库的初始化
    db.init_app(app)
    db.create_all(app=app)
    return app


def register_buleprint(app):
    app.register_blueprint(userController.user)
